﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserManager.aspx.cs" Inherits="EnvironmentManagerSystem.UserManager.UserManager"
    Theme="TextBox" %>

<%@ Import Namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户管理</title>

    <script src="../Script/artDialog.js?skin=aero" type="text/javascript"></script>

    <script src="../Script/iframeTools.js" type="text/javascript"></script>

    <script src="../Script/UserManager.js" type="text/javascript"></script>

    <script src="../Script/ShowMinPage.js" type="text/javascript"></script>

    <link href="../Style/css.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #Button1
        {
            width: 176px;
        }
    </style>
</head>
<body style="background: #e0e2e7; overflow: visible;">
    <form id="form1" runat="server">
    <div style="text-align: center; width: 100%">
        <table align="center" style="width: 100%;">
            <tr>
                <td style="text-align: left; vertical-align: middle;" valign="middle">
                    用户名：<asp:TextBox ID="txtUserName" runat="server" Width="150px"></asp:TextBox>
                </td>
                <td style="text-align: left; vertical-align: middle;">
                    用户类型：<asp:DropDownList ID="ddlUserType" runat="server" Width="150px" DataTextField="UserKind"
                        DataValueField="UserKind">
                    </asp:DropDownList>
                </td>
                <td style="text-align: left; vertical-align: middle;">
                    角色类型：<asp:DropDownList ID="ddlRoleType" runat="server" Width="150px" DataTextField="Name"
                        DataValueField="id">
                    </asp:DropDownList>
                </td>
                <td style="text-align: right; vertical-align: top;">
                    <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="anniu1" OnClick="btnSearch_Click" />
                    <asp:Button ID="btnReset" runat="server" Text="重置" CssClass="anniu1" OnClick="btnReset_Click"
                        Style="margin-left: 10px; margin-right: 10px;" />
                </td>
            </tr>
            <tr>
                <td style="text-align: right; vertical-align: middle; height: 10px;" align="right">
                    <asp:HiddenField ID="hidUserName" runat="server" />
                </td>
                <td style="text-align: right; vertical-align: middle; height: 10px;" align="right">
                    <asp:HiddenField ID="hidUserType" runat="server" />
                </td>
                <td style="text-align: right; vertical-align: middle; height: 10px;" align="right">
                    <asp:HiddenField ID="hidRoleType" runat="server" />
                </td>
                <td style="text-align: right; vertical-align: middle; height: 10px;" align="right">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td style="text-align: center; vertical-align: top;" colspan="4">
                    <asp:GridView ID="gdvUser" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        ForeColor="#333333" GridLines="Vertical" Width="99%" DataKeyNames="ID" BorderColor="Silver"
                        HorizontalAlign="Center" EmptyDataText="无数据" AllowPaging="True" OnRowCancelingEdit="gdvUser_RowCancelingEdit"
                        OnRowEditing="gdvUser_RowEditing" PageSize="50" OnRowUpdating="gdvUser_RowUpdating"
                        OnPageIndexChanged="gdvUser_PageIndexChanged" OnPageIndexChanging="gdvUser_PageIndexChanging"
                        OnDataBound="gdvUser_DataBound">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#F0F2F3" Font-Size="12px" Height="16px" HorizontalAlign="Center"
                            VerticalAlign="Middle" />
                        <Columns>
                            <asp:BoundField HeaderText="用户名" DataField="UserName" />
                            <asp:BoundField HeaderText="登陆名" DataField="LoginName" />
                            <asp:TemplateField HeaderText="密码">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Password") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("PasswordAdmin") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="电话" DataField="Phone" />
                            <asp:BoundField DataField="RoleId" HeaderText="角色" ReadOnly="True" />
                            <asp:BoundField HeaderText="类型" DataField="UserKind" />
                            <asp:TemplateField HeaderText="启用">
                                <EditItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("InUse").ToString()=="1"?true:false %>' />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("InUse").ToString()=="1"?"是":"否" %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="False" HeaderText="操作">
                                <EditItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
                                        Text="更新"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
                                        Text="取消"></asp:LinkButton>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
                                        Text="编辑"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Delete"
                                        Text="删除" Visible="false" OnClientClick="javascript:return confirm('是否删除')"></asp:LinkButton>
                                    &nbsp; <a onclick="frm.show('UserManager/UserRole.aspx?ID=<%# Eval("ID")%>&UserName=<%# Eval("UserName") %>','用户角色管理',true,400,200)"
                                        style="text-decoration: underline; cursor: hand;">角色赋予</a>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerStyle ForeColor="Black" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle Font-Bold="True" ForeColor="#00286F" CssClass="right_list01_tit" BackColor="#507CD1" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td style="text-align: left; vertical-align: top; height: 30px;" colspan="4">
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    <div style="position: fixed; bottom: 0px; background: #e0e2e7; width: 100%;" runat="server"
        id="divInsert">
        <table width="100%">
            <tr>
                <td align="right">
                    <input id="Button2" type="button" value="添加用户" class="anniu1" onclick="frm.show( 'UserManager/AddUser.aspx','添加用户',true,300,270)" /><asp:Button
                        ID="Button3" runat="server" Text="刷新" CssClass="anniu1" OnClick="Button3_Click"
                        Style="margin-left: 10px; margin-right: 20px;" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
